var express = require("express");
var path = require("path");
var app = express();
app.listen(6080);
app.use("/",express.static(path.join(process.cwd(),"www_root")));

app.get("/upload",function(req,res)
{
	console.log(req.query);
	res.send("Lihaowebrequest");
});

var fs=require("fs");
app.put("/UploadFile",function(req,res)
	{
	//打开一个文件
	var fd = fs.openSync("./www_root/Sounds/serverFile001.amr","w");
	req.on("data",function(data){
		fs.write(fd,data,0,data.length,function(){})
		res.send("serverFile001");
	});
	
	res.on("end",function(){
		
		fs.close(fd,function(){});
	})
});